/**
 * 
 */
package com.recording.system.sensor;

import java.util.ArrayList;

import com.recording.system.events.RecordingSystemEvent;
import com.recording.system.events.RecordingSystemEventKind;
import com.recording.system.signalsource.SignalSource;

/**
 * @author bpkx1031
 *
 */
public class AutoTransmissionChangeSensor extends AbstractSensor{

	public AutoTransmissionChangeSensor(int sourceId) {
		super(sourceId);
	}
	
	private int transmissionNumber = 0;
	@Override
	public void readSignalSource(SignalSource source,
			ArrayList<RecordingSystemEvent> res) {
		int newTransmissionNumber = (int) source.getValue();
		if (transmissionNumber != newTransmissionNumber)
		{
			RecordingSystemEvent event = new RecordingSystemEvent(RecordingSystemEventKind.MANUAL_TRANSMISSION_CHANGE, "Manual transmission changed, new transmission : " + newTransmissionNumber);
			res.add(event);
			transmissionNumber = newTransmissionNumber;
		}
		
		
	}
}
